package com.ruoyi.web.controller.dibang;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.Fdongbei.domain.dibang.GuozhongDo;
import com.ruoyi.system.Fdongbei.domain.vo.reqvo.CarInfoReqVo;
import com.ruoyi.system.Fdongbei.domain.vo.reqvo.CarTotalInfoVo;
import com.ruoyi.system.Fdongbei.domain.vo.reqvo.XiangXiInfo;
import com.ruoyi.system.Fdongbei.service.dibang.CarInfoServiceImpl;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/carInfo")
public class CarInfoController extends BaseController {
    @Resource
    private CarInfoServiceImpl carInfoService;

    @PostMapping("/cornCarShInfo")
    public AjaxResult cornCarShInfo(@RequestBody CarInfoReqVo carInfoReqVo) {

        return carInfoService.selectCornCarShInfo(carInfoReqVo);
    }


    /*
        查询玉米贸易粮信息
     */
    @PostMapping("/cornCarTradeInfo")
    public AjaxResult cornCarTradeInfo(@Validated @RequestBody CarInfoReqVo carInfoReqVo) {
        return carInfoService.selectCornCarTradeInfo(carInfoReqVo);
    }

    /*
        查询玉米中储粮信息
     */

    @PostMapping("/cornCarSinotransInfo")
    public AjaxResult cornCarSinotransInfo(@Validated @RequestBody CarInfoReqVo carInfoReqVo) {
        return carInfoService.selectCornCarSinotransInfo(carInfoReqVo);
    }
    @PostMapping("/coalCarInfo")
    public AjaxResult coalCarInfo(@RequestBody CarInfoReqVo carInfoReqVo) {
        return carInfoService.selectCoalCarInfo(carInfoReqVo);
    }

    @PostMapping("/coalTrainInfo")
    public AjaxResult coalTrainInfo(@RequestBody @Validated CarInfoReqVo carInfoReqVo) {
        return carInfoService.selectCoalTrainInfo(carInfoReqVo);
    }

    @PostMapping("/exportInfo")
    public AjaxResult exportInfo(@RequestBody @Validated CarInfoReqVo carInfoReqVo) {
        return carInfoService.selectExportInfo(carInfoReqVo);
    }

    @PostMapping("/carInfo")
    public AjaxResult carInfo(@RequestBody CarInfoReqVo carInfoReqVo) {
        return carInfoService.selectCarInfo(carInfoReqVo);
    }

    @PostMapping("/update/guozhong")
    public AjaxResult updateGuozhong(@RequestBody GuozhongDo guozhongDo){
        return carInfoService.updateGuozhong(guozhongDo);
    }

    @PostMapping("/carTotalInfo")
    public AjaxResult carTotalInfo(@RequestBody CarTotalInfoVo carTotalInfoVo){
        return carInfoService.selectTotalInfo(carTotalInfoVo);
    }

    @PostMapping("/xiangXiInfo")
    public AjaxResult xiangXiInfo(@RequestBody XiangXiInfo xiangXiInfo){
        return carInfoService.selectXiangXiInfo(xiangXiInfo);
    }
<<<<<<< HEAD

=======
>>>>>>> b4a0e2dba4b1f1e0b05e6d155df4272830d06f27
    @GetMapping("/xiangXiAllInfo/{czbh}")
    public AjaxResult xiangXiAllInfo(@PathVariable("czbh") String czbh){
        return carInfoService.selectXiangXiAllInfo(czbh);
    }
}
